package org.abc.program.entity;

import org.springframework.stereotype.Component;

/**
 * user用户实体类
 */
@Component  // 类交由spring bean容器管理，在spring配置文件已注明此处
public class User {
	private Long id;  // 用户id，自增长
	private String username;  // 用户登录名
	private String password;  // 登录密码
	private Long roleId;  // 所属角色id
	private String photo;  // 头像照片地址
	private Integer age;  // 年龄
	private String address;  // 家庭住址

	public User() {
	}

	public User(Long id, String username, String password, Long roleId, String photo, Integer age, String address) {
		this.id = id;
		this.username = username;
		this.password = password;
		this.roleId = roleId;
		this.photo = photo;
		this.age = age;
		this.address = address;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Long getRoleId() {
		return roleId;
	}

	public void setRoleId(Long roleId) {
		this.roleId = roleId;
	}

	public String getPhoto() {
		return photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Override
	public String toString() {
		return "User{" +
				"id=" + id +
				", username='" + username + '\'' +
				", password='" + password + '\'' +
				", roleId=" + roleId +
				", photo='" + photo + '\'' +
				", age=" + age +
				", address='" + address + '\'' +
				'}';
	}
}
